package com.cody.service.impl;

import com.cody.dao.StudentDao;
import com.cody.entity.Student;
import com.cody.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
class StudentServiceImpl implements StudentService {

    @Autowired
    private StudentDao studentDao;

    @Override
    public List<Student> findAll() {
        return studentDao.findAll();
    }

    @Override
    public List<Student> queryAllStudent() {
        return studentDao.queryAllStudent();
    }

    @Override
    public boolean delStudentByStudentId(Integer studentId) {
        return studentDao.delStudentByStudentId(studentId);
    }

    @Override
    public Student querySingleStudent(String studentNumber,String studentPassword) {
        return studentDao.querySingleStudent(studentNumber,studentPassword);
    }

    @Override
    public List<Student> queryStudentByKeyword(String keyword) {
        return studentDao.queryStudentByKeyword(keyword);
    }

    @Override
    public Student querySingleStudentByStudentNumber(String studentNumber) {
        return studentDao.querySingleStudentByStudentNumber(studentNumber);
    }

    @Override
    public boolean insertSingleStudent(Student student) {
        return studentDao.insertSingleStudent(student);
    }

    @Override
    public boolean updateStudentInfo(Student student) {
        return studentDao.updateStudentInfo(student);
    }

    @Override
    public boolean updateStudentPwd(String stuNumber, String password) {
        return studentDao.updateStudentPwd(stuNumber,password);
    }
}
